package Demo1;

/**
 * @Author: Lenovo
 * @Date: 2024/5/17 13:56
 * @description:
 */
public class Animal {
    public String name;
    public int age;
    static {
        System.out.println("static()::Animal....");
    }
    {
        System.out.println("Animal实例代码块...");
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal构造代码块");
    }

    public void eat(){
        System.out.println(this.name+"正在吃饭....");
    }
}
